import request from '@utils/request'

export const getAllProjectList = (data) => {
    return request.get(`/api/project/projectlistpage?uid=${data.uid}&page=${data.pageNo}&pagesize=${data.pageSize}`)
}
export const getProjectLists = (data) => {
    return request.get(`/api/project/projectlist?keyword=${data.keyword ? data.keyword : ""}&uid=${data.uid}`)
}
export const getUserList = (data) => {
    return request.get(`/api/basedata/userlist?page=${data.page}&pagesize=50&keyword=${data.keyword}`)
}
export const newProjectAdd = (data) => {
    return request.post(`/api/project/add`, data)
}
export const newProjectEdit = (data) => {
    return request.post(`/api/project/edit`, data)
}
export const newProjectDetail = (data) => {
    return request.get(`/api/project/detail?project_id=${data}`)
}
export const getStageCurrInfo = (data) => {
    return request.get(`/api/project/getStageCurrInfo?class_id=${data.class}&project_id=${data.id}`)
}
//会议时间列表
export const getMettingLists = (data) => {
    return request.get(`/api/project/meeting/list?project_id=${data}&page=1&pagesize=100`)
}
export const getMettingAdd = (data) => {
    return request.post(`/api/project/meeting/add`, data)
}
export const getMettingDel = (data) => {
    return request.get(`/api/project/meeting/del?id=${data}`)
}
//修改会议的状态
export const changeMettingStatus = (data) => {
    return request.get(`/api/project/meeting/set/status?id=${data.id}&status=${data.status}&reason=${data.reason}`)
}
//修改项目当前阶段的状态
export const changeCurrStageStatus = (data) => {
    return request.post(`/api/project/project/stage/chagestatus`, data)
}
//标记项目为重点项目
export const markImport = (data) => {
    return request.post(`/api/project/set/status`, data)
}
//check项目number是否重复
export const findProjectNo = (data) => {
    return request.get(`/api/project/findProjectNo?project_no=${data}`)
}
//check项目number是否重复
export const projectDel = (data) => {
    return request.get(`/api/project/del?project_id=${data}`)
}
export default {
    getAllProjectList, getProjectLists, getUserList, newProjectAdd,
    newProjectEdit, newProjectDetail, getStageCurrInfo, getMettingLists,
    getMettingAdd, getMettingDel, changeMettingStatus, changeCurrStageStatus,
    markImport, findProjectNo, projectDel
}